#include <iostream>

int main()
{
    int a;
    std::cout << "a = " << a << std::endl;
    static int b;
    std::cout << "b = " << b << std::endl;
    int arr1[5];
    for(int i = 0; i < 5; i++) {
        std::cout << "arr1[" << i << "] = " << arr1[i] << ", &arr1[" << i << "] = " << &arr1[i] << std::endl;
    }
    std::cout << std::endl;

    int arr2[] = {1, 2, 3, 4, 5};
    for(int i = 0; i < 6; i++) {
        std::cout << "arr2[" << i << "] = " << arr2[i] << ", &arr2[" << i << "] = " << &arr2[i] << std::endl;
    }
    std::cout << std::endl;

    static int arr3[] = {1, 2, 3, 4, 5};
    for(int i = 0; i < 5; i++) {
        std::cout << "arr3[" << i << "] = " << arr3[i] << ", &arr3[" << i << "] = " << &arr3[i] << std::endl;
    }
    std::cout << std::endl;

    int *p1 = new int;
    *p1 = 7;
    std::cout << "*p1 = " << *p1 << ", p1 = " << p1 << std::endl;
    delete p1;
    p1 = nullptr;

    int *arr4 = new int[5];
    for(int i = 0; i < 5; i++) 
        arr4[0] = i + 1;
    for(int i = 0; i < 5; i++) 
        std::cout << "arr4[" << i << "] = " << arr4[i] << ", &arr4[" << i << "] = " << &arr4[i] << std::endl;
    delete [] arr4;
    arr4 = nullptr;
    std::cout << std::endl;

}
